package data.join.com.network;

import java.util.HashMap;
import java.util.Map;

import data.join.com.network.gson.FileNameUploadResponse;
import data.join.com.network.gson.UploadFileToken;
import data.join.com.socket.RegisterInfo;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * Created by hefuyi on 16/8/16.
 */
public interface ApiService {

    @POST("api/v1/video_device/records")
    Call<Object> uploadVideoFileName(@Body RequestBody requestBody);

    @FormUrlEncoded
    @POST("api/v1/video_device/upload_tokens")
    Call<UploadFileToken> getToken(@Field("filename") String file_name,@Field("type") String type);

    @FormUrlEncoded
    @POST("api/v1/video_device/devices")
    Call<RegisterInfo> devicesRegister(@Field("imei") String imei,@Field("app_version") String appVersion);

    @PUT("api/v1/video_device/commands/{id}")
    Call<Object> updateCommand(@Path("id") String command, @Body RequestBody requestBody);

    @POST("api/v1/video_device/emergency_videos")
    Call<FileNameUploadResponse> uploadLockVideo(@Body RequestBody requestBody);

    @Streaming
    @GET
    Call<ResponseBody> downloadFile(@Url String fileUrl);
}
